import React,{Suspense} from 'react';

import routes from './router/routeConfig'

import { useRoutes } from 'react-router-dom'

const App = () => {
  
  //生成路由规则
  var RouterView = useRoutes(routes)

  return (
    <div className='app'>
      
      {/* 渲染路由规则 */}
      <Suspense fallback={<div className='loading'>loading...</div>}>
        { RouterView }
      </Suspense>

    </div>
  );
};

export default App;